package design.mode.effective_java.chapter4.item19;

import java.time.Instant;
import java.util.Comparator;

/**
 * @author ZhongMingde on 2021/8/14
 * 构造函数不能直接或间接调用可重写的方法
 */

public class Sub extends Super{

    private final Instant instant;

    Sub(){
        instant  = Instant.now();
    }

    @Override
    public void overrideMe(){
        System.out.println(instant);
    }

    public static void main(String[] args) {
        Sub sub = new Sub();
        sub.overrideMe();
    }
}
